import request from '@/utils/request'

export function list(data) {
  return request({
    url: '/system/menu/list',
    method: 'get',
    params: data
  })
}
export function listByParent(data) {
  return request({
    url: '/system/menu/listByParent',
    method: 'post',
    data: data
  })
}
export function treeselect(data) {
  return request({
    url: '/system/menu/treeselect',
    method: 'get',
    params: data
  })
}

export function add(data) {
  return request({
    url: '/system/menu/add',
    method: 'post',
    data: data
  })
}
export function edit(data) {
  return request({
    url: '/system/menu/edit',
    method: 'post',
    data: data
  })
}
export function remove(data) {
  return request({
    url: '/system/menu/delete',
    method: 'post',
    data: data
  })
}
export function getInfo(data) {
  return request({
    url: '/system/menu/' + data,
    method: 'get'
  })
}

// 新增菜单
export function save(data) {
  return request({
    url: '/system/menu',
    method: 'post',
    data: data
  })
}

// 修改菜单
export function update(data) {
  return request({
    url: '/system/menu',
    method: 'put',
    data: data
  })
}

// 查询菜单详细
export function getById(companyMenuId) {
  return request({
    url: '/system/menu/' + companyMenuId,
    method: 'get'
  })
}

